import request from '@/utils/request'

export function uploadFile(data) {
  return request({
    url: 'file/attachFile/attachUpload',
    method: 'POST',
    data
  })
}

export function getProBycusId(data) {
  return request({
    url: `/ord/order/ordproject/getProBycusId?cusId=${data}`,
    method: 'get'
  })
}
/********人力外包********/
export function epibolySave(data) {
  return request({
    url: 'ord/order/ordhro/save',
    method: 'POST',
    data
  })
}

export function epibolyList(data) {
  return request({
    url: `ord/order/ordhro/getListByRcId/${data}`,
    method: 'POST'
  })
}

export function epibolyDelete(data) {
  return request({
    url: `ord/order/ordhro/delete/${data}`,
    method: 'POST'
  })
}

export function epibolyUpdate(data) {
  return request({
    url: '/ord/order/ordhro/update',
    method: 'POST',
    data
  })
}

/********合同信息********/
export function contractInfoList(data) {
  return request({
    url: 'ord/order/ordregcontract/list',
    method: 'POST',
    data
  })
}

export function contractInfoDelete(params) {
  return request({
    url: `ord/order/ordregcontract/delete/${params}`,
    method: 'POST'
  })
}

export function contractInfoSave(data) {
  return request({
    url: 'ord/order/ordregcontract/save',
    method: 'POST',
    data
  })
}

export function contractDetails(data) {
  return request({
    url: `ord/order/ordregcontract/${data}`,
    method: 'get'
  })
}

export function contractInfoUpdate(data) {
  return request({
    url: 'ord/order/ordregcontract/update',
    method: 'POST',
    data
  })
}

/********验收计划********/
export function checkProSave(data) {
  return request({
    url: '/ord/order/ordprojectcheck/save',
    method: 'post',
    data
  })
}

export function checkProDelete(data) {
  return request({
    url: `/ord/order/ordprojectcheck/delete/${data}`,
    method: 'post'
  })
}

export function checkProUpdate(data) {
  return request({
    url: '/ord/order/ordprojectcheck/update',
    method: 'post',
    data
  })
}

export function checkProList(data) {
  return request({
    url: `/ord/order/ordprojectcheck/getListByRcId/${data}`,
    method: 'post'
  })
}

/********合同模板********/

/**
 * @param 删除信息
 */
export function contractDelete(params) {
  return request({
    url: `/ord/order/ordcontracttemplate/delete/${params}`,
    method: 'post'
  })
}

/**
 * @param 获取列表
 */
export function contractList(params) {
  return request({
    url: '/ord/order/ordcontracttemplate/list',
    method: 'post',
    data: params
  })
}

/**
 * @param 保存新增信息
 */
export function contractSave(params) {
  return request({
    url: '/ord/order/ordcontracttemplate/save',
    method: 'post',
    data: params
  })
}

/**
 * @param 更新信息
 */
export function contractUpdate(params) {
  return request({
    url: '/ord/order/ordcontracttemplate/update',
    method: 'post',
    data: params
  })
}

/**
 * @param 获取详情
 */
export function contractdetails(params) {
  return request({
    url: `/ord/order/ordcontracttemplate/${params}`,
    method: 'get'
  })
}

/**
 * 删除文件
 */

export function delFile(data) {
  return request({
    method: 'post',
    url: `file/attachFile/attachDelete?fileName=${encodeURI(data)}`
  })
}

// 获取管理订单
export function getOrderList(params) {
  return request({
    method: 'get',
    url: 'ord/ordorder/getList',
    params
  })
}

// 无权限控制合同列表
export function contractInfoListNoPriv(data) {
  return request({
    url: 'ord/order/ordregcontract/listNoPriv',
    method: 'POST',
    data
  })
}
